<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>gh3</title>
    
</head>
<body>

</body>
<script src="../vendors/jquery-2.1.0.min.js"></script>
<script src="../vendors/underscore-min.js"></script>

<script src="../vendors/async.js"></script>
<script src="../gh3.js"></script>
<script>

	//get some repositories of k33g
	var k33g = new Gh3.User("k33g")
	,	k33gRepositories = new Gh3.Repositories(k33g)
	,	k33gBlog;
	

	async.series([
	    function(callback){
	        k33gRepositories.fetch({page:1, per_page:100, direction : "desc"},"next", function (err, res) {
	        	if(err) { throw "outch ..." }
				console.log("1- Repositories", k33gRepositories);
				callback(null, k33gRepositories);
	        });


	    },
	    function(callback){
	    	k33gBlog = k33gRepositories.getRepositoryByName("k33g.github.com");
			console.log("2- k33g.github.com",k33gBlog);
			callback(null, k33gBlog);
	    },
	    function(callback){
			k33gBlog.fetch(function (err, res) {
				if(err) { throw "outch ..." }
				console.log("3- Repository : ", k33gBlog);
				callback(null, k33gBlog);
			});

	    }
	],

	function(err, results){
    	console.log(results);
	});

		
</script>
</html>
